﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using RoadTeam.Model.Base;
using System.Data;
using RoadTeam.Enums;


namespace RoadTeam.Model
{
    [Table(TableName = "TbEvlutionText")]
    public class TbEvlutionText : iTableEntityBase
    {

        public TbEvlutionText()
        {
            TableName = @"TbEvlutionText";
            EntityMap = Db_DataType.Table;
        }

        /// <summary>
        /// 所有字段名
        /// </summary>
        protected override void SetFieldNames()
        {
            PropertyNames = new string[] { "UniqueIdentifier","ID","Name","Code","CreateDate","Remark"};
        }


        #region 属性
        /// <summary>
        ///
        /// </summary>
        [Column(ColumnName = "UniqueIdentifier", IsPrimaryKey = true,Identity = false, DbType = "varchar", Length = 50, CanBeNull = false,Description =""),DefaultValue("")]
        public string UniqueIdentifier
        {
            get { return getProperty<string>("UniqueIdentifier"); }
            set { setProperty("UniqueIdentifier", value); }
        }
        /// <summary>
        ///
        /// </summary>
        [Column(ColumnName = "ID", IsPrimaryKey = false,Identity = true, DbType = "decimal", Length = 18, CanBeNull = false,Description =""),DefaultValue("")]
        public decimal ID
        {
            get { return getProperty<decimal>("ID"); }
            set { setProperty("ID", value); }
        }
        /// <summary>
        ///
        /// </summary>
        [Column(ColumnName = "Name", IsPrimaryKey = false,Identity = false, DbType = "varchar", Length = 1000, CanBeNull = true,Description =""),DefaultValue("")]
        public string Name
        {
            get { return getProperty<string>("Name"); }
            set { setProperty("Name", value); }
        }
        /// <summary>
        ///
        /// </summary>
        [Column(ColumnName = "Code", IsPrimaryKey = false,Identity = false, DbType = "varchar", Length = 1000, CanBeNull = true,Description =""),DefaultValue("")]
        public string Code
        {
            get { return getProperty<string>("Code"); }
            set { setProperty("Code", value); }
        }
        /// <summary>
        ///
        /// </summary>
        [Column(ColumnName = "CreateDate", IsPrimaryKey = false,Identity = false, DbType = "datetime", Length = 23, CanBeNull = true,Description =""),DefaultValue("")]
        public DateTime? CreateDate
        {
            get { return getProperty<DateTime?>("CreateDate"); }
            set { setProperty("CreateDate", value); }
        }
        /// <summary>
        ///
        /// </summary>
        [Column(ColumnName = "Remark", IsPrimaryKey = false,Identity = false, DbType = "varchar", Length = 2000, CanBeNull = true,Description =""),DefaultValue("")]
        public string Remark
        {
            get { return getProperty<string>("Remark"); }
            set { setProperty("Remark", value); }
        }
        #endregion
        #region 插入方法
        /// <summary>
        /// 对象插入数据库
        /// </summary>
        /// <param name="O">插入的对象</param>
        /// <param name="IExcept">剔除不需要插入的列</param>
        /// <param name="Con">连接字符串</param>
        /// <returns>是否插入成功</returns>
        public static bool InserObjedct(TbEvlutionText O, List<String> IExcept, String Con)
        {
            return TbEvlutionText.InserObjedct(typeof(TbEvlutionText), O, IExcept,Con);
        }

        /// <summary>
        /// 对象插入数据库
        /// </summary>
        /// <param name="O">插入的对象</param>
        /// <param name="Con">连接字符串</param>
        /// <returns>是否插入成功</returns>
        public static bool InserObjedct(TbEvlutionText O, String Con)
        {
            return TbEvlutionText.InserObjedct(typeof(TbEvlutionText), O, null,Con);
        }

        /// <summary>
        ///  数据集插入到数据库表
        ///  暂不支持回写自增长ID
        /// </summary>
        /// <param name="dt">数据集</param>
        /// <param name="Con">连接字符串</param>
        /// <returns></returns>
        public static bool InsertDatatable(DataTable dt, String Con)
        {
            return TbEvlutionText.InsertDatatable(typeof(TbEvlutionText), dt,Con);
        }
         //TODO:这里添加其他插入方法
        #endregion

        #region 查找方法
        /// <summary>
        /// 查找数据集合
        /// </summary>
        /// <param name="where">条件对象</param>
        /// <param name="Con">连接字符串</param>
        /// <returns>数据集合</returns>
        public static DataTable Select(SqlWhere where,String Con)
        {
            return TbEvlutionText.Select(typeof(TbEvlutionText), where,Con);
        }

         /// <summary>
        /// 查找数据集合
        /// </summary>
        /// <param name="where">条件对象</param>
        /// <param name="Con">连接字符串</param>
        /// <returns>数据集合</returns>
        public static DataTable Select(QueryPage page,String Con)
        {
            return TbEvlutionText.Select(typeof(TbEvlutionText), page,Con);
        }

        public static DataTable Select(OQLWhere where,String SelectColumn, String Con)
        {
            return TbEvlutionText.Select(typeof(TbEvlutionText), where,SelectColumn, Con);
        }

         //TODO:这里添加其他查找方法
        #endregion

        #region 删除方法
        /// <summary>
        /// 删除指定数据
        /// </summary>
        /// <param name="where">条件集合</param>
        /// <param name="Con">连接字符串</param>
        /// <returns>是否删除成功</returns>
        public static bool Delete(OQLWhere where, String Con)
        {
            return TbEvlutionText.Delete(typeof(TbEvlutionText), where,Con) > 0;
        }
         //TODO:这里添加其他删除方法
        #endregion
        #region 修改方法
        /// <summary>
        /// 对象更新某指定行数值
        /// </summary>
        /// <param name="O">对象</param>
        /// <param name="Con">连接字符串</param>
        /// <returns></returns>
        public static bool Update(TbEvlutionText O,String Con)
        {
            return TbEvlutionText.Update(typeof(TbEvlutionText), O, Con) > 0;
        }

        /// <summary>
        ///   数据集合更新数据库
        ///   数据集合中的列明必须要和数据库中的列明一一对应
        /// </summary>
        /// <param name="dt">数据集</param>
        /// <param name="Con">连接字符串</param>
        /// <returns></returns>
        public static bool Update(DataTable dt, String Con)
        {
            return TbEvlutionText.Update(typeof(TbEvlutionText), dt,  Con) > 0;
        }
        //TODO:这里添加其他修改方法
        #endregion
    }
}

